home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist / dist6.3 / gl_dev.idb / usr / include / gl / kb.h.z / kb.h
C/C++ Source or Header  |  1996-12-06  |  3KB  |  91 lines

  1. #ifndef __GL_KB_H__
  2. #define __GL_KB_H__
  3. /**************************************************************************
  4.  *                                      *
  5.  *          Copyright (C) 1987, Silicon Graphics, Inc.          *
  6.  *                                      *
  7.  *  These coded instructions, statements, and computer programs  contain  *
  8.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  9.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  10.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  11.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  12.  *                                      *
  13.  **************************************************************************/
  14.  
  15. /*
  16.  * kb.h
  17.  *
  18.  * $Revision: 1.3 $
  19.  */
  20.  
  21. #ifndef NULL
  22. #define NULL 0
  23. #endif
  24.  
  25. /* constants for the iris keyboard */
  26. #define    KB_BEEPCMD    0x00        /* low bit clear --> beep commands */
  27. #define    KB_LEDCMD    0x01        /* low bit set --> led commands */
  28. #define    KB_RESET    0x10        /* reset the keyboard */
  29. #define    KB_REPLY    110        /* first byte of reply from keyboard
  30.                      * after reset - second is read from
  31.                      * DIP switches
  32.                      */
  33. /* beep commands */
  34. #define    KB_NOCLICK    0x08        /* disable click */
  35. #define    KB_AUTOREPEAT    0x80        /* enable autorepeat */
  36. #define    KB_SHORTBEEP    0x02        /* do a short beep */
  37. #define    KB_LONGBEEP    0x04        /* do a long beep */
  38.  
  39. /* led commands */
  40. #define LAMP_NUMLOCK    0x01
  41. #define LAMP_CAPSLOCK    0x02
  42. #define LAMP_SCROLLLOCK 0x04
  43. #define LAMP_L1        0x08
  44. #define LAMP_L2        0x10
  45. #define LAMP_L3        0x20
  46. #define LAMP_L4        0x40
  47.  
  48. /* predefined shift state bits */
  49. #define KB_STATE_SHIFT    0x0001
  50. #define KB_STATE_CTRL    0x0002
  51. #define KB_STATE_ALT    0x0004
  52.  
  53. /* predefined special shift states (never used as shift state bits) */
  54. #define KB_STATE_CAPSLOCK    0x0100
  55. #define KB_STATE_META_BIT8    0x0200
  56. #define KB_STATE_META_ESC    0x0400
  57.  
  58. /* values for t_type */
  59. #define KB_TABLECODE    1
  60. #define KB_SEQ_TABLE    2
  61. #define KB_SEQ_FUNC    3
  62.  
  63. /* defaults */
  64. #define KB_BEEPDEFAULT        (KB_BEEPCMD | KB_NOCLICK | KB_AUTOREPEAT)
  65. #define KB_LEDDEFAULT        KB_LEDCMD
  66.  
  67. /* values for sd_kstate */
  68. #define KB_DEPRESSED    0x01    /* shift key depressed */
  69. #define KB_LOCKED    0x02    /* shift key locked */
  70.  
  71. /* convert scancode from keyboard into keycode and up/down value */
  72. #define KB_SCANCTOKEYC(c)   ((c) & 0x7f)
  73. #define KB_SCANCTOUPDN(c)   (!((c) & 0x80))
  74.  
  75. /* map keycode to GL device */
  76. #define KB_DEVOFF1        1
  77. #define KB_DEVOFF2        60
  78. #define KB_KEYCTODEV(c)        ((((c) + KB_DEVOFF1) <= MAXKBDBUT) \
  79.                     ? ((c) + KB_DEVOFF1) \
  80.                     : ((c) + KB_DEVOFF2))
  81.  
  82. /* map device to keycode */
  83. #define KB_DEVTOKEYC(d)        ((d) - ((ISXKEYBD(d))?KB_DEVOFF2:KB_DEVOFF1))
  84.  
  85. /* out-of-bounds values generated by keys that gl_kbtrans() doesn't translate */
  86. #define    KB_OOB_BREAK    0xff00
  87. #define    KB_OOB_SETUP    0xff01
  88. #define    KB_OOB_NOSCRL    0xff02
  89.  
  90. #endif    /* !__GL_KB_H__ */
  91.